package cn.yunhe.shop;

import java.io.IOException;
import java.net.UnknownHostException;

public class OrderHello {
	public static void main(String[] args) throws UnknownHostException, IOException {

		String orderInfoById = new OrderServer().getOrderInfo("007");
		System.out.println("服务器端返回的值："+orderInfoById);
		
//		Socket client = new Socket("127.0.0.1",8080);
//		//服务器端的包   类  方法 的参数和类型
//		String packageName = "cn.yunhe.shop/r/n";
//		String className = "OrderServer/r/n";
//		String method = "getOrderInfo/r/n";
//		String argVal = "NO:007/r/n";
//		//编码
//		client.getOutputStream().write(packageName.getBytes(Charset.forName("UTF-8")));
//		client.getOutputStream().write(className.getBytes(Charset.forName("UTF-8")));
//		client.getOutputStream().write(method.getBytes(Charset.forName("UTF-8")));
//		client.getOutputStream().write(argVal.getBytes(Charset.forName("UTF-8")));
//		
//		client.shutdownOutput();
//		String reponseData = "";
//		byte[] b = new byte[1];
//		while(client.getInputStream().read(b)!=-1) {
//			reponseData = reponseData + new String(b);
//		}
//		
//		System.out.println("服务器端返回的值："+reponseData);
//		
//		client.close();
		
	}
}
